package com.example.demo.study.thread;

public class MyThread extends Thread{
    public MyThread()
    {
        System.out.println(super.getName()+" is used");
    }
    @Override
    public void run()
    {
        for (int i = 0; i < 100; i++) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+" is running");
        }
    }

    public static void main(String[] args) {
        MyThread a=new MyThread();
        a.run();
    }
}
